package com.ruowei.modules.sys.domain;

import com.ruowei.common.entity.PrimaryKeyAutoIncrementEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.ZonedDateTime;

/**
 * 登录登出相关日志表
 */
@ApiModel(description = "登录登出相关日志表")
@Entity
@Table(name = "login_related_log")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class LoginRelatedLog extends PrimaryKeyAutoIncrementEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户账号
     */
    @ApiModelProperty(value = "用户账号")
    @Column(name = "login_code")
    private String loginCode;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    @Column(name = "user_name")
    private String userName;

    /**
     * 用户角色
     */
    @ApiModelProperty(value = "用户角色")
    @Column(name = "user_role")
    private String userRole;

    /**
     * 操作类型
     */
    @ApiModelProperty(value = "操作类型")
    @Column(name = "operate_type")
    private String operateType;

    /**
     * 操作时间
     */
    @ApiModelProperty(value = "操作时间")
    @Column(name = "operate_time")
    private ZonedDateTime operateTime;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public String getLoginCode() {
        return loginCode;
    }

    public void setLoginCode(String loginCode) {
        this.loginCode = loginCode;
    }

    public LoginRelatedLog loginCode(String loginCode) {
        this.loginCode = loginCode;
        return this;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public LoginRelatedLog userName(String userName) {
        this.userName = userName;
        return this;
    }

    public String getUserRole() {
        return userRole;
    }

    public void setUserRole(String userRole) {
        this.userRole = userRole;
    }

    public LoginRelatedLog userRole(String userRole) {
        this.userRole = userRole;
        return this;
    }

    public String getOperateType() {
        return operateType;
    }

    public void setOperateType(String operateType) {
        this.operateType = operateType;
    }

    public LoginRelatedLog operateType(String operateType) {
        this.operateType = operateType;
        return this;
    }

    public ZonedDateTime getOperateTime() {
        return operateTime;
    }

    public void setOperateTime(ZonedDateTime operateTime) {
        this.operateTime = operateTime;
    }

    public LoginRelatedLog operateTime(ZonedDateTime operateTime) {
        this.operateTime = operateTime;
        return this;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof LoginRelatedLog)) {
            return false;
        }
        return id != null && id.equals(((LoginRelatedLog) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "LoginRelatedLog{" +
            "id=" + getId() +
            ", loginCode='" + getLoginCode() + "'" +
            ", userName='" + getUserName() + "'" +
            ", userRole='" + getUserRole() + "'" +
            ", operateType='" + getOperateType() + "'" +
            ", operateTime='" + getOperateTime() + "'" +
            "}";
    }
}
